[][src]Crate market

Infrastructure for producers and consumers in a market.

A market is a stock of goods. A producer stores goods in the market while a consumer retrieves goods from the market.

In the rust stdlib, the primary example of a market is std::sync::mpsc::channel. std::sync::mpsc::Sender is the producer and std::sync::mpsc::Receiver is the consumer.

Modules

channel

Implements Consumer and Producer for various types of channels.

io

Implements Consumer and Producer for std::io::Read and std::io::Write trait objects.

process

Implements Consumer and Producer for the stdio's of a process.

sync

Implements synchronization items.

thread

Implements Consumer for thread functionality.

Structs

ClosedMarketFault

An error interacting with a market due to the market being closed.

Collector

A Consumer that consumes goods of type G from multiple Consumers.

Distributor

Distributes goods to multiple producers.

PermanentQueue

An unlimited queue with a producer and consumer that are always functional.

Recall

Returns a good that a Producer failed to produce.

UnlimitedQueue

Defines a queue with unlimited size that implements Consumer and Producer.

VigilantConsumer

Consumes goods that an Inspector has allowed.

Enums

ConsumeFailure

A Consumer failed to consume a good.

Never

A type that can never be constructed.

ProduceFailure

A Producer failed to produce a good.

Traits

Consumer

Retrieves goods from a market.

Inspector

Inspects if goods meet defined requirements.

Producer

Stores goods in a market.